package com.ruoyi.system.mapper.wlwsys;

import com.ruoyi.system.domain.wlwsys.WlwsysPosition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface WlwsysPositionMapper {

    @Select("select * from wlwsys_position")
    public List<WlwsysPosition> selectAll();

    @Select("select * from wlwsys_position where nick_name is not null ")
    public List<WlwsysPosition> selectNameExit();

    @Select("select * from wlwsys_position where user_id = #{id}")
    public WlwsysPosition selectById(Long id);

    @Select("select * from wlwsys_position where user_id = #{p}")
    public WlwsysPosition selectByPosition(Integer p);

    @Select("select * from wlwsys_position where nick_name = #{name}")
    public WlwsysPosition selectByName(String name);

    @Select("select * from wlwsys_position order by position_id")
    public List<WlwsysPosition> selectAllOrderPosition();

    @Update("update wlwsys_position set nick_name=null,user_id=null where position_id = #{num}")
    public void deleteMessage(Integer num);

    @Update("update wlwsys_position set nick_name=#{name},user_id=#{id} where position_id=#{p}")
    public void updateMessage(@Param("p")Integer p,@Param("name")String name,@Param("id")Long id);
}
